'''
''' Override the ${Add Button}_Click and add a new record row.
'''
Public Overrides Sub ${Add Button}_Click(ByVal sender As Object, ByVal args As ImageClickEventArgs)
Try
DbUtils.StartTransaction()
' First, save the data on the editable table.
Me.SaveData()
Me.Page.CommitTransaction(sender)
' Add a new empty row to the editable table.
Me.AddNewRecord = 1
Catch ex As Exception
' Report error message to the user
Utils.MiscUtils.RegisterJScriptAlert(Me, "UNIQUE_SCRIPTKEY", ex.Message)
Me.Page.RollBackTransaction(sender)
Finally
DbUtils.EndTransaction()
End Try
End Sub
|